<template>
	<view>
			<view class="activity-list">
				<view class="list" v-for="(item,index) in list" :key="index" @click="jump(`/pageB/noticeList/noticeInfo?id=${item.id}&type=${type}&name=详情`)">
					<view class="date">
						<text>{{item.createtime}}</text>
					</view>
					<view class="item">
						<view class="title" v-if="item.name">
							<text class="one-omit">{{item.name}}</text>
						</view>
						<view class="pictrue" v-if="item.image">
							<image :src="$fun.imgUrl(item.image)" mode=""></image>
						</view>
						<view class="describe">
							<text class="two-omit">{{item.title}}</text>
						</view>
					</view>
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				type:null
			}
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
				title:options.name
			})
			// 新闻
			this.type = options.type
			 this.$fun.ajax.post('news/index',{type:options.type}).then(res => {
				this.list = res.data;
			})
		},
		methods: {
			jump(url){
				this.$fun.jump(url)
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: rgb(245,245,245);
	}
.activity-list{
		padding: 20rpx 4%;
		.list{
			width: 100%;
			margin-bottom: 10px;
			.date{
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 100rpx;
				text{
					padding: 10rpx 30rpx;
					background-color: rgba(0,0,0,0.2);
					color: #FFFFFF;
					font-size: 26rpx;
					border-radius: 10rpx;
				}
			}
			.item{
				padding: 0 4%;
				// height: 500rpx;
				background-color: #FFFFFF;
				border-radius: 10rpx;
				.title{
					display: flex;
					align-items: center;
					width: 100%;
					height: 100rpx;
					text{
						font-size: 32rpx;
						color: #222222;
					}
				}
				.pictrue{
					position: relative;
					width: 100%;
					height: 300rpx;
					image{
						width: 100%;
						height: 100%;
					}
					.hint{
						position: absolute;
						left: 0;
						top: 0;
						display: flex;
						align-items: center;
						justify-content: center;
						width: 100%;
						height: 100%;
						background-color: rgba(0,0,0,0.3);
						text{
							font-size: 32rpx;
							color: #FFFFFF;
						}
					}
				}
				.describe{
					display: flex;
					align-items: center;
					width: 100%;
					height: 100rpx;
					text{
						font-size: 28rpx;
						color: #959595;
					}
				}
			}
		}
	}
</style>
